package org.study;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;

public class FsDemo {


    public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, NoSuchFieldException {
        Class aClass = Class.forName("org.study.Demo");
        Object o = aClass.newInstance();
        Method method = aClass.getMethod("print");
        Field fx = aClass.getDeclaredField("fx");
        fx.setAccessible(true);
        Class<?> type = fx.getType();
        boolean assignableFrom = type.isAssignableFrom(Integer.class);
        System.out.println(assignableFrom);
        System.out.println(type);
        fx.set(o, "牛逼");
        Object invoke = method.invoke(o);
        System.out.println("yesr");
    }
    
}
